package com.globefrog.framework.common.exception;


import lombok.Getter;

/**
 * api 错误异常
 *
 * @author caijinbang
 * @date 2020-12-07 22:34
 */
public class ApiErrorException extends RuntimeException {

  private static final long serialVersionUID = -5426298883793009635L;

  @Getter
  private Integer status;

  public ApiErrorException(Integer status, String message) {
    super(message);
    this.status = status;
  }

  public ApiErrorException(String message) {
    super(message);
  }

  public ApiErrorException(Integer status, Throwable cause) {
    super("request error http-status: " + status + ", error: " + cause.getMessage(), cause);
    this.status = status;
  }
}
